import { Component, OnInit } from "@angular/core";

import { Observable, of } from "rxjs";
import { User } from "./user";
import { Test07Service } from "./test07.service";

@Component({
  selector: "app-test07",
  templateUrl: "./test07.component.html",
  styleUrls: ["../style.css", "./test07.component.css"]
})
export class Test07Component implements OnInit {
  constructor(private service: Test07Service) {}

  ngOnInit() {
    this.setUsers();
  }

  lst: User[];

  setUsers() {
    this.service.getUsers().subscribe(data => (this.lst = data));
  }
}
